<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdvToutiao extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('adv_toutiaos', function (Blueprint $table) {
            $table->comment = '头条广告监控';
            $table->increments('id');
            $table->string('adid')->default('')->comment('广告计划id');
            $table->string('cid')->default('')->comment('广告创意id');
            $table->tinyInteger('csite')->default(0)->comment('广告投放位置');
            $table->tinyInteger('ctype')->default(0)->comment('创意样式');
            $table->string('idfa')->default('')->comment('iOS手机广告唯一标识');
            $table->string('androidid')->default('')->comment('用户终端AndroidId原值');
            $table->string('imei')->default('')->comment('用户终端的IMEI,15 位数字，md5加密');
            $table->string('source')->default('')->comment('来源');
            $table->tinyInteger('os')->comment('操作系统的类型0.Android,1.iOS,2.WP,3.Other');
            $table->text('callback_url')->comment('回调地址');
            $table->tinyInteger('user_status')->default(0)->comment('当前状态0.点击，1.进入首页，2.注册,3.放款');
            $table->timestamp('user_click_time')->nullable()->comment('用户点击时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('adv_toutiaos');
    }
}
